<style>
  *{
	margin: 0;
	padding: 0;
  }
  ul,ol{
    list-style: none;
  }
  .clearfix::after{
    content: "";
    display: table;
    clear: both;
    height: 0;
    visibility: hidden;
  }
  .clearfix{
    zoom:1;
  }
  html, body{
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  .manage-form{
    display: flex;
    height: 100%;
    align-items: center;
  }
  /* 系统标题 */
  .manage-title{
    color: #000000;
    font-family: PingFang SC;
    font-style: normal;
    font-size: 50px;
    line-height: 70px;
  }
  /* 系统标识 */
  .manage-identification{
    font-size: 24px;
    line-height: 34px;
    color: #828282;
  }
  /* flex布局下的两个div分割 */
  .manage-division{
    width: 100%;
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: center;
  }
  /* 右边背景图 */
  .background-image{
    background-image: url('<%= image_url "background.png" %>');
    background-repeat: round;
  }
  .manage-content{
    width: 100%;
    text-align: center;
  }
  /* 登录的黑色框 */
  .manage-login{
    background: #0A1227;
    height: 450px;
    width: 500px;
    border-radius: 10px;

  }
  /* 帐号登录的标题 */
  .manage-right-title{
    font-size: 30px;
    line-height: 100%;
    color: #FFFFFF;
    margin-top: 30px;
    margin-bottom: 26px;
  }
  /* 输入框样式 */
  .manage-right-input{
    width: 425px;
    height: 44px;
    background: #2C324F;
    border: 1px solid #2C324F;
    border-radius: 4px;
    margin-bottom: 3%;
    padding-left: 4%;
    color: #E0E0E0;
  }
  /* 提示标语 */
  .manage-right-lable{
    font-size: 14px;
    line-height: 10%;
    color: #FFFFFF;
    margin-bottom: 6%;
  }
  /* 单选框样式 */
  .manage-right-radio{
    border: 1px solid #FFFFFF;
    box-sizing: border-box;
    border-radius: 4px;
  }
  .manage-right-radio-layout{
    margin-bottom: 2%;
  }
  /* 单选按钮标语 */
  .manage-right-radio-lable{
    font-size: 14px;
    line-height: 21px;
    color: #FFFFFF;
  }
  /* 登录按钮 */
  .manage-right-btn{
    width: 445px;
    height: 50px;
    border-radius: 4px;
    background: #247FF1;
    border: 1px solid #2C324F;
    color: #FFFFFF;
    font-size: 16px;
    align-items: center;
    display: flex;
    justify-content: center;
  }
  .manage-right-laylout{
    width: 100%;
    padding: 25px;
  }
</style>

<div class="manage-form">
  <div class="manage-division">
    <div class="manage-content">
      <div><%= image_tag 'Seven.png', width: '234px', height: '235px; '%></div>
      <br>
      <div class="manage-identification">Seven</div>
    </div>
  </div>

  <div class="manage-division background-image">
    <div class="manage-login">
      <div class="manage-right-laylout">
        <div class="manage-right-title">帐号登录</div>
        <form action="/admin/sessions/login_admin_user" class="simple_form" accept-charset="UTF-8" method="post">
          <input autofocus="autofocus" lay-verify="required" class="manage-right-input" id="admin_account_number" maxlength="30" name="admin_user[account_number]" size="30" type="tel" value="" placeholder="登录帐号">
          <input class="manage-right-input" id="manage_password" maxlength="128" name="admin_user[password]" size="30" type="password" placeholder="密码">
          <div class="manage-right-lable">*如需获取新账号 或忘记密码请联系管理员</div>
          <div class="manage-right-radio-layout">
            <input type="checkbox" class="manage-right-radio" name="remember_password" checked />
            <label for="password" class="manage-right-radio-lable">记住密码</label>
          </div>
          <div class="form-action submit">
            <div class="manage-right-btn" id="submit_sign_in">账户登录</div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<script>
  $(document).on('click', '#submit_sign_in', function(){
    var url = $(this).parents('form').attr('action')
    var number = $('#admin_account_number').val()
    var password = $('#manage_password').val()
    if (number.length <= 0 || password.length <= 0){
      layer.msg('请输入正确的用户名或密码',{
        shade: [0.1,'#fff'],
        offset: '400px',
        time: 1000
      })
      return false
    }
    $.ajax({
      method: 'POST',
      url: url,
      data: {
        account_number: number,
        password: password
      },
      success:function(res){
        if(res["status"]){
          layer.msg(res['msg'],{
            shade: [0.1,'#fff'],
            offset: '400px',
            time: 2000
          })
          window.location.href = '/admin'
        }else{
          layer.msg(res['msg'],{
            shade: [0.1,'#fff'],
            offset: '400px',
            time: 2000
          })
        }
      }
    })
  })
</script>